From: Juergen Gross Date: Fri, 26 Aug 2016 11:58:55 +0000 (+0200) Subject: libxc: correct max_pfn calculation for saving domain X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~509 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=9daed8321b44c3ca82e412eb130f84e6b6c17dc5;p=xen.git libxc: correct max_pfn calculation for saving domain Commit 91e204d37f44913913776d0a89279721694f8b32 ("libxc: try to find last used pfn when migrating") introduced a bug for the case of a domain supporting the virtual mapped linear p2m list: the maximum pfn of the domain calculated from the p2m memory allocation might be too low. Correct this. Reported-by: Stefan Bader Signed-off-by: Juergen Gross Tested-by: Stefan Bader Acked-by: Wei Liu --- diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c index 4a29460a31..7043409231 100644 --- a/tools/libxc/xc_sr_save_x86_pv.c +++ b/tools/libxc/xc_sr_save_x86_pv.c @@ -430,6 +430,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3) if ( level == 2 ) { + if ( saved_idx == idx_end ) + saved_idx++; max_pfn = ((xen_pfn_t)saved_idx << 9) * fpp - 1; if ( max_pfn < ctx->x86_pv.max_pfn ) {